<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTablePostTag extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//
		Schema::create('post_tag', function($table){
			$table->bigIncrements('id');
			$table->bigInteger('post')->unsigned();
			$table->bigInteger('tag')->unsigned();
			$table->timestamps();
			$table->softDeletes();

			$table->foreign('post')->references('id')->on('post');
			$table->foreign('tag')->references('id')->on('tag');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
	}

}
